package com.coldchain.order.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.coldchain.common.msg.BaseResponse;
import com.coldchain.common.vo.BizDispatchingVo;
import com.coldchain.order.entity.BizDispatchingOrder;
import com.coldchain.order.entity.BizDistributionOrderFromBean;
import com.coldchain.order.entity.OrderSearch;
import com.fangliai.core.entitiy.PageResponse;

import java.util.List;

/**
 * <p>
 * 配送订单 服务类
 * </p>
 *
 * @author fangliai
 * @since 2018-11-14
 */
public interface IBizDispatchingOrderService extends IService<BizDispatchingOrder> {
    /**
     * 查询配送订单列表
     *
     * @return
     */
    List<BizDispatchingVo> getDispatchingOrderList(OrderSearch search);

    /**
     * 查询配送订单并分页面
     *
     * @param search
     * @return
     */
    PageResponse<BizDispatchingVo> getDispatchingOrderPage(OrderSearch search);

    PageResponse<BizDispatchingVo> getSimpleOrderPage(OrderSearch search);

    /**
     * 获取简约订单数据集
     * @param search
     * @return
     */
    List<BizDispatchingVo> getSimpleOrderList(OrderSearch search);


    /**
     * 创建业务订单
     *
     * @param orderFromBean
     */
    BaseResponse createOrder(BizDistributionOrderFromBean orderFromBean) throws Exception;


    /**
     * 获取配送订单祥情
     * @param orderId
     * @return
     */
    public Object getOrderDetail(String orderId);


    /**
     * 获取下一个配送点
     * @param orderId
     * @return
     */
    public  BaseResponse getNextTask(String orderId);

    /**
     * 获取下步配送任务
     * @param uid
     * @param orderId
     * @param sort
     * @param receipts
     * @param accessorys
     * @return
     */
    public BaseResponse doNext(String uid,String orderId,Integer sort,String receipts,String accessorys)throws Exception;

    /**
     * 上报异常
     * @param uid
     * @param orderId
     * @param currentNode
     * @param receipts
     * @param errorCode
     * @param errorMsg
     * @return
     */
    public BaseResponse reportError(String uid,String orderId,Integer currentNode,String receipts,Integer errorCode,String errorMsg)throws Exception;
}
